package com.example.medicalrecord.AggregationModule.sickness.controller;

import com.example.medicalrecord.AggregationModule.sickness.pojo.dto.SicknessQuery;
import com.example.medicalrecord.AggregationModule.sickness.pojo.entity.Sickness;
import com.example.medicalrecord.AggregationModule.sickness.service.SicknessService;
import com.example.medicalrecord.base.response.JsonResult;
import com.example.medicalrecord.base.response.PageData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/v1/sickness")
public class SicknessController {
    @Autowired
    SicknessService sicknessService;

    @GetMapping("select")
    public JsonResult selectSickness(SicknessQuery sicknessQuery){
        log.debug("查询病史功能:sicknessQuery={}",sicknessQuery);
        PageData pageData = sicknessService.selectSickness(sicknessQuery);
        return JsonResult.ok(pageData);
    }
}
